package com.qhy.springcloud.service;

import com.qhy.springcloud.api.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @author qiuhongyu
 * @date 2020/10/10 14:59
 */
@Component
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",
        fallbackFactory = DeptclientServiceFallbackFactory.class)
public interface DeptClientService {
    @GetMapping("/queryDept/{id}")
    public Dept queryDept(@PathVariable("id") Long id);

    @PostMapping("addDept")
    public boolean addDept(Dept dept);

    @GetMapping("queryDepts")
    public List<Dept> queryDepts();
}
